<script setup>
import { ref,onMounted } from "vue"
import {useRoute} from "vue-router" 
import axios from "axios"
import { router } from "../../../router"

const route = useRoute()

const myImage = ref(route.query.image)

onMounted(()=>{
    document.title = "我的头像 - EvenSO"
})

const goToSetUpdateMyImage = () => {
    router.push({
        path: "/account/face/upload",
        query: {
            image: route.query.image
        }
    })
}

</script>

<template>
    <div class="myImageAllBox">
        <div class="myTitleBox">
            <div class="shuXian"></div>
            <span>我的头像</span>
        </div>
        <div class="myImageBox">
            <div class="myImageBox1">
                <div class="myImageBox1_1">
                    <img :src="myImage" alt="" />
                    <div class="setUpdateMyImage" @click="goToSetUpdateMyImage">
                        <span>更换头像</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<style scoped>
.myImageAllBox{
    width: 100%;
    height: 100%;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}
.shuXian{
    position: absolute;
    left: 20px;
    top: 10px;
    width: 5px;
    height: 15px;
    background: rgb(0,160,216);
    border-radius: 50px;
}
.myTitleBox{
    position: absolute;
    left: 168px;
    top: 10px;
    width: 100%;
    height: 8.5%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.myTitleBox span{
    position: absolute;
    left: 30px;
    top: 6px;
    width: 200px;
}
.myImageBox{
    position: absolute;
    left: 15%;
    top: 10%;
    width: 85%;
    height: 90%;
}
.myImageBox1{
    width: 100%;
    height: 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    
}
.myImageBox1_1{
    width: 20%;
    height: 80%;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.myImageBox1_1 img:nth-child(1){
    width: 60%;
    height: 60%;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
}
.setUpdateMyImage{
    position: absolute;
    left: 37%;
    top: 15%;
    width: 6%;
    height: 10%;
    background: rgb(0,160,216);
    border-radius: 50%;
    user-select: none;
    cursor: pointer;
}
.setUpdateMyImage span{
    position: absolute;
    left: 24%;
    top: 17%;
    width: 60%;
    height: 60%;
    font-size: 14px;
    color:#fff;
}
</style>